package vg.services.user_interface_manager.interfaces;


import java.awt.Component;

import javax.swing.JFrame;

import vg.services.data_base_manager.interfaces.IModel;
import vg.services.plugin_manager.event_and_request.event.AUIEvent;
import vg.services.plugin_manager.event_and_request.event.UIEventModelReset;
import vg.services.plugin_manager.event_and_request.request.AUIRequest;

/**
 * This class is class, which determines methods for user interface.
 * @author tzolotuhin
 *
 */
public abstract class AUserInterface {
	protected final IModel model;
	/**
	 * This constructor sets feedback for controller to null.
	 */
	public AUserInterface(IModel model) {
		this.model = model;
	}
	/**
	 * This methods returns model.
	 */
	public IModel getModel() {
		return(this.model);
	}
	
	public void reset() {
		if (model != null) {
			model.resetModel();
			addEvent(new UIEventModelReset());			
		}
	}
	//-------------------------------------------------------------------------
	public abstract void addMenuItem(AMenuItem item, String place);
	public abstract void addInstrument(AUserInterfaceElement element);
	public abstract void addElement(AUserInterfaceElement element, String place);
	//-------------------------------------------------------------------------	
	public abstract void addRequest(AUIRequest request);
	public abstract void addEvent(AUIEvent event);
	public abstract void quit();
	
	/**
	 * Returns main frame, which may use how parent for different dialogs   
	 */
	public abstract JFrame getMainFrame();
}
